﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CFGTool
{
    /// <summary>
    /// 每个按钮tag参数绑定的对象
    /// </summary>
    public class KeyData
    {
        /// <summary>
        /// 按键代码名称
        /// </summary>
        public string KeyName { get; set; }

        /// <summary>
        /// 数据列表
        /// </summary>
        public List<string> Value
        {
            get { return _Value; }
            set { _Value = value; }
        }
        public List<string> _Value;

        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="value">数据</param>
        public void Add(string value)
        {
            _Value.Add(value);
        }

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="value">数据</param>
        public void Del(string value)
        {
            _Value.Remove(value);
        }

        /// <summary>
        /// 清除数据
        /// </summary>
        public void Clear()
        {
            _Value.Clear();
        }

        /// <summary>
        /// 是否有数据
        /// </summary>
        public bool HaveData
        {
            get
            {
                if (_Value.Count > 0) { return true; }
                else { return false; }
            }
        }
    }
}
